<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import CURDTable from '@/framework/components/table/CURDTable'
import YesNoBoolEnum from '@/infra/constant/YesNoBoolEnum'
import SearchTypeEnum from '@/feature/pms/infra/constants/SearchTypeEnum'
import OrderTypeEnum from '@/feature/pms/infra/constants/OrderTypeEnum'
import { productApi } from '@/feature/pms/infra/api/productApi'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: productApi,
        showSelection: false,
        columns: [
          // {
          //   label: '直播间主播openid',
          //   prop: 'authorOpenid'
          // },
          {
            label: '商品ID',
            width: 200,
            prop: 'productId'
          }, {
            label: '排序类型',
            width: 200,
            hiddenInTable: true,
            searchable: true,
            type: ColumnType.SELECT,
            options: SearchTypeEnum,
            prop: 'searchType'
          }, {
            label: '排序方式',
            width: 200,
            hiddenInTable: true,
            searchable: true,
            type: ColumnType.SELECT,
            options: OrderTypeEnum,
            prop: 'orderType'
          }, {
            label: '商品名称',
            width: 300,
            searchable: true,
            prop: 'title'
          }, {
            label: '商品主图',
            width: 100,
            prop: 'cover',
            type: ColumnType.IMAGE
          }, {
            label: '商品价格',
            width: 90,
            prop: 'price'
          }, {
            label: '券后价格',
            width: 80,
            prop: 'couponPrice'
          },
          {
            label: '分佣比例(%)',
            width: 120,
            prop: 'cosRatio'
          }, {
            label: '佣金金额(元)',
            width: 120,
            prop: 'cosFee'
          }, {
            label: '是否有库存',
            width: 100,
            type: ColumnType.RADIO,
            options: YesNoBoolEnum,
            prop: 'inStock'
          },
          {
            label: '销量',
            width: 100,
            prop: 'sales'
          },
          {
            label: '商品链接',
            width: 120,
            viewDetail: true,
            prop: 'detailUrl'
          }, {
            label: '店铺ID',
            width: 120,
            prop: 'shopId'
          }, {
            label: '店铺名称',
            width: 200,
            prop: 'shopName'
          }, {
            label: '一级类目',
            width: 100,
            prop: 'firstCid'
          }, {
            label: '二级类目',
            width: 100,
            prop: 'secondCid'
          }, {
            label: '三级类目',
            width: 100,
            prop: 'thirdCid'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

